feat(platform): add mobile platform support (iOS, Android, scaling, gamepad, CI) - #663
Conversation
|
Claude finished @aram-devdocs's task in 3m 39s —— View job PR Review: feat(platform): add mobile platform support (iOS, Android, scaling, gamepad, CI)7-Phase Review Checklist
Verdict: CHANGES REQUESTEDSolid implementation overall — the FFI design is clean, layer compliance is maintained, and the test coverage is good. However, there are several issues worth addressing before merge. BLOCKERS
WARNINGS
Positive Callouts
Specific Code NotesB1 — Vibration silent no-op ( The function stores a vibration intensity in B2 — Missing SDK generated bindings The PR description says "C# SDK: Updated C header with new FFI exports (via codegen)" and "Python SDK: Updated C header with new FFI exports (via codegen)". Searching W1 — iOS smoke test bundle ID
W5 — Missing proguard-rules.pro ( The release build references |
…ive scaling, gamepad, and CI Implements five mobile platform issues: - #281: iOS Flappy Bird example with touch/keyboard/mouse input - #304: Android Flappy Bird example with touch/keyboard/gamepad input - #305: Mobile CI with simulator/emulator runtime smoke tests - #306: DPI-aware responsive scaling with safe area insets - #307: Gamepad/controller input via gilrs with FFI exports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… limit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d220c00 to
6742a64
Compare
gilrs depends on libudev-sys on Linux, which requires the libudev-dev package to be installed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…5min - Copy gradlew wrapper script to examples/android/flappy_bird/ - Increase iOS build pipeline timeout from 15 to 25 minutes (3 arch builds) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ssertion - iOS: add swift build fallback for SPM package, use generic simulator destination - Android: check package installed instead of activity foreground (no GPU in CI) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…wift The wgpu backend requires Metal framework for GPU initialization on iOS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Building static libraries for 3 iOS architectures (device + 2 simulator) takes ~20min on macOS CI runners without cache hits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Overview
Type: feature
Summary:
Add comprehensive mobile platform support: iOS and Android Flappy Bird examples with touch/keyboard/gamepad input, DPI-aware responsive scaling with safe area insets, gamepad/controller FFI via gilrs integration, and mobile CI with full simulator/emulator runtime smoke tests.
Related Issues: Fixes #281, Fixes #304, Fixes #305, Fixes #306, Fixes #307
Changes Made
Engine Core (
goud_engine/src/)scale_factorfield toRenderViewportandSafeAreaInsetsstruct in platform layerget_scale_factor()andget_safe_area_insets()toPlatformBackendtrait with default implsWinitPlatform(from winit) andGlfwPlatform(computed from framebuffer ratio)MAX_GAMEPAD_SLOTSconstant incore::input_managergilrscrate for cross-platform gamepad polling (MFi on iOS, Android Game Controller API)libs/platform/gilrs_bridge.rsfor clean separationFFI Layer (
goud_engine/src/ffi/)ffi/input/gamepad.rs: 11 FFI functions for gamepad queries (buttons, axes, sticks, triggers, connection, vibration)ffi/window/mobile.rs: 4 FFI functions for scale factor, safe area insets, logical/framebuffer sizecodes.rsC# SDK (
sdks/csharp/)Python SDK (
sdks/python/)TypeScript SDK (
sdks/typescript/)Codegen Pipeline (
codegen/)./codegen.shProc Macros (
goud_engine_macros/)Tools (
tools/)WASM (
goud_engine/src/wasm/)Examples (
examples/)examples/ios/flappy_bird/: Standalone SPM-based iOS Flappy Bird with touch, keyboard, and mouse inputexamples/android/flappy_bird/: Standalone Gradle-based Android Flappy Bird with touch, keyboard, and gamepad inputDocumentation
Architectural Compliance
#[no_mangle] extern "C"and#[repr(C)]where neededunsafeblock without a// SAFETY:commentTesting
cargo testpasses (4768 tests, 0 failures)cargo clippy -- -D warningsis cleancargo fmt --all -- --checkpassespython3 sdks/python/test_bindings.py) — if SDK changeddotnet test sdks/csharp.tests/) — if SDK changedcd sdks/typescript && npm test) — if TS SDK changedpython3 codegen/validate.py && python3 codegen/validate_coverage.py) — 648/648 functions mappedCode Quality
todo!()orunimplemented!()in production code#[allow(unused)]without justification commentResult, notunwrap()/expect()in library codeDocumentation
AGENTS.mdfiles (if architecture changed)README.md(if user-facing behavior changed)Breaking Changes
None
Version Bump
Bump type: minor
Justification: New features (mobile examples, gamepad FFI, viewport scaling) without breaking changes
Security
unsafeblocks — or each one has a// SAFETY:comment and is necessarycargo deny check)Performance
N/A — gilrs polling adds negligible overhead (event-driven, no busy wait). Viewport scale factor is a single f32 read per frame.
Deployment
Reviewer Notes
timeout-minutes: 15to prevent runaway buildsreactivecircus/android-emulator-runnerfor reliable boot in CIexamples/csharp/flappy_goud/assets/sprites/to avoid duplication